from datetime import datetime

from pydantic import BaseModel, Field
from typing import List, Optional


class BaseCheckin(BaseModel):
    user_id: Optional[int] = Field(0, description="用户id")
    checkin_time: Optional[datetime]


class CheckinCreate(BaseCheckin):
    ...


class CheckinUpdate(BaseCheckin):
    id: int

    def update_dict(self):
        return self.model_dump(exclude_unset=True, exclude={"id"})
